﻿using System.Security.Principal;
using Mysoft.Platform.Component.Attributes;
using Mysoft.Platform.Component.Config;

namespace Mysoft.Platform.Component.Security
{
	public class LoginUser
	{
		public static UserGroup GetUserGroup(IIdentity identity)
		{
			if( AppConfiguration.AdminGroup.Contains(identity.Name.ToLowerInvariant()) )
				return UserGroup.Admin;

			return UserGroup.User;
		}
	}
}